package com.hzgj.bcl.soa.rpc.server;

import lombok.Getter;
import lombok.Setter;

/**
 * Created by dell on 2015/4/3.
 */
@Getter
@Setter
public class ServerConfig {

    protected int ioRatio = 80;
    protected boolean reuseAddress = true;
    protected boolean nodelay = true;
    protected int port = -1;
    protected String host = null;
    protected boolean suspend = true;
    protected String name;
    @Deprecated
    protected boolean asyncDispatching;
    protected int bossGroupThreads = 2;
    protected int workerGroupThreads = Runtime.getRuntime().availableProcessors() * 2;
    protected BizThreadPoolConfig bizThreadPoolConfig = new BizThreadPoolConfig();
    protected String protocol;
    // 单位秒, 默认 20 分钟
    protected int keepAliveTime = 20 * 60;

    @Getter
    @Setter
    public static class BizThreadPoolConfig {
        private String id;
        private int min = 20;
        private int max = 800;
        private long keepLiveInSecond = 30;
        private int queueSize = 100;
    }
}
